<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="/context/mytags.jsp" %>
<div class="table-scrollable">
    <table class="table table-striped table-hover table-success">
        <thead>
        <tr>
            <th>序号</th>
            <th>用户名</th>
            <th>真实姓名</th>
            <th>年龄</th>
            <th>性别</th>
            <th>医院</th>
            <th>科室</th>
            <th>接诊数量</th>
            <th>账号</th>
            <th>账户状态</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${page.result}" var="doctors" varStatus="vs">
            <tr>
                <%--序号--%>
                <td>${vs.count + page.offset}</td>
                <%--用户名--%>
                <td>
                    ${doctors.userName}
                </td>
                <%--真实姓名--%>
                <td>
                    <a href="javascript:;"
                       onclick="show('/doctors/show?id=${doctors.doctorsId}&pageType=<spring:message code="hospital.pagyType"></spring:message>')">
                            ${doctors.name}
                    </a>
                </td>
                <%--年龄--%>
                <td>${doctors.age}</td>
                <%--性别--%>
                <td>
                    <c:if test="${doctors.sex == 0}">woman</c:if>
                    <c:if test="${doctors.sex == 1}">man</c:if>
                    <c:if test="${doctors.sex == 2}">confidentiality</c:if>
                </td>
                <%--医院名称--%>
                <td>${doctors.hospitalName}</td>
                <%--所在科室名称--%>
                <td>${doctors.departmentName}</td>
                <%--接诊数量--%>
                <td>${doctors.admissionsCount}</td>
                <%--账号--%>
                <td>${doctors.account}</td>
                <%--账户状态：1、可使用；0、禁用--%>
                <td>
                    <a href="javascript:;"
                       onclick="changeStatus('/doctors/changeStatus?id=${doctors.doctorsId}')">
                        <c:if test="${doctors.accountStastus == 0}">启用</c:if>
                        <c:if test="${doctors.accountStastus == 1}">禁用</c:if>
                    </a>
                </td>
                <%--操作--%>
                <td>
                    <a href="javascript:;" class="btn btn-sm blue"
                       onclick="update('/doctors/doctors?id=${doctors.doctorsId}&pageType=<spring:message code="hospital.pagyType"></spring:message>')">
                        <i class="fa fa-edit"></i>编辑
                    </a>
                    <a href="javascript:;" class="btn btn-sm red" onclick="del('/doctors/delete?id=${doctors.doctorsId}&pageType=<spring:message code="hospital.pagyType"></spring:message>')">
                        <i class="fa fa-trash"></i>删除
                    </a>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</div>
<div class="pageination-panel">${page}</div>